Fix deallocation span for locals freed by become tail calls#4943
Fix deallocation span for locals freed by become tail calls#4943LaneAsade wants to merge 2 commits intorust-lang:masterfrom
become tail calls#4943Conversation
|
Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two. |
|
Thanks for looking into this, and sorry for the slow review! However, I don't think this logic is correct. Once you set I think this will require work in the core interpreter. Here on the Miri side, the best we can do are hard-to-get-right and, worse, hard-to-maintain hacks. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This PR fixes #4863
The problem was due to the fact that
before_memory_deallocationusedcurrent_user_relevant_spanto record where an allocation was freed, which produced wrong spans for the locals deallocated by abecometail call.The solution was to introduce a new field called
tail_call_spanonMiriMachinewhich recordsbecomeexpression's span inbefore_terminatorif aTailCallterminator is detected and then use that span inbefore_memory_deallocationinstead of the current one.